/** keyof */
// https://www.typescriptlang.org/docs/handbook/2/keyof-types.html

type Point = {x: number, y: number};
type K = keyof Point; // 实际上是 x ｜ y
const k: K = "x";


type Point1 = { [key: number]: string };
type K1 = keyof Point1; // number;
// const k1: K1 = ""; // 报错，因为k1是number类型
const k1: K1 = 123;

type Point2 = { [key: string]: string};
type K2 = keyof Point2; // string | number ; 是不是很奇怪？？？官网解释是key会自动执行toString。所以obj[0] === obj["0"]是true。这个地方背下来




